
<div id="main">
<div id="contents_stat">
<form name="filters" action="#" method="post" >
<fieldset>
<legend>&#160;<label sid="dhcp.clients"></label>&#160;</legend>
<div class="frame_tab_layer">
    <table width="100%" border="0" cellpadding="0" cellspacing="0" class="cmenutitle" id="dhcplistid">
           
    </table>
</div>
</fieldset>
</form>
</div>
</div>



<script type="text/javascript" src="js/libTable.js"></script>
<script type="text/javascript">
	load_html();
	var virtual_data = new Array();
	function load_html(){
		var sendtext = 'status?get&param=WROC_DHCPClients';
	DataRequest("none",sendtext,function(data){
		if(data["dhcpclient"]!=""){
		var tmparray = strToJSON(data["dhcpclient"]);
		virtual_data = tmparray;
		virtual_paint_list(tmparray);
	}
});
}

function virtual_paint_list(data){
 var data_new=new Array();
 var j=0;
  for(var i=0;i<data.length;i++){
  	var ID = parseInt(parseInt(i)+1);
 	var networkname=replacestr(data[i][0]);
 	var mac=replacestr(data[i][1]);
 	var ip=replacestr(data[i][2]);
 	var isuserd=replacestr(data[i][3]);
    isuserd = time_reversal(isuserd);
  data_new.push({ID:ID,networkname:networkname,mac:mac,ip:ip,isuserd:isuserd});
  j = i;
 }
 var fun_arr = {};
 var tab = new libTable(new Array(firewall.no,inet.hostname,inet.mac,inet.ip,dhcp.expire),data_new,1,10);
 print_table("dhcplistid",tab,fun_arr, true);
    function time_reversal(times){
        var timeArray = times.split(":");
        var h = parseInt(timeArray[0]);
        var m = parseInt(timeArray[1]);
        var s = parseInt(timeArray[2]);
        if(getQueryStr("language")=="chinese"){
            var time = h+"时 "+m+"分 "+s+"秒";
        }else{
            var time = h+"h: "+m+"m: "+s+"s";
        }

        return time;
    }
}
</script>
